# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-sfalearn
pkgname=('python2-sfalearn' 'python-sfalearn')
_pkgname=sfalearn
pkgver=0.0.10
pkgrel=9
pkgdesc='A python framework for working with Learning algorithms in Automata.'
arch=('any')
url='https://pypi.org/project/sfalearn/#files'
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('1e9707bd12640775820bff78a44ddde27f22d3f7086ae24c0ef5e292f13d9b1bf81c0b73f24e5108e58feeec993649684d3c062ca7acdb81520e731557e29272')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-sfalearn() {
  depends=('python2' 'python2-symautomata')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-sfalearn() {
  depends=('python' 'python-symautomata')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

